
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>02-搭建Electron运行环境 · 千锋大前端小册-Electron</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="古艺散人">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="03-Main Process API.html" />
    
    
    <link rel="prev" href="01-Electron介绍.html" />
    

    
        <link rel="shortcut icon" href='../source/images/favicon.jpg' type="image/x-icon">
    
    
        <link rel="bookmark" href='../source/images/favicon.jpg' type="image/x-icon">
    
    
        <link rel="apple-touch-icon" href='../source/images/apple-touch-icon.jpg'>
    
    
        
        <link rel="apple-touch-icon" sizes="120x120" href="../source/images/apple-touch-icon.jpg">
        
        <link rel="apple-touch-icon" sizes="180x180" href="../source/images/apple-touch-icon.jpg">
        
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"lurongtao","repo":"felixbooks-electron","type":"star","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01-Electron介绍.html">
            
                <a href="01-Electron介绍.html">
            
                    
                    基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="01-Electron介绍.html">
            
                <a href="01-Electron介绍.html">
            
                    
                    01-Electron介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="02-搭建Electron运行环境.html">
            
                <a href="02-搭建Electron运行环境.html">
            
                    
                    02-搭建Electron运行环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="03-Main Process API.html">
            
                <a href="03-Main Process API.html">
            
                    
                    03-Main Process API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="04-Renderer Process API.html">
            
                <a href="04-Renderer Process API.html">
            
                    
                    04-Renderer Process API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="05-IPC通信.html">
            
                <a href="05-IPC通信.html">
            
                    
                    05-IPC通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="06-Shared API.html">
            
                <a href="06-Shared API.html">
            
                    
                    06-Shared API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="07-特性和技巧.html">
            
                <a href="07-特性和技巧.html">
            
                    
                    07-特性和技巧
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../project/">
            
                <a href="../project/">
            
                    
                    项目实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../project/01-环境搭建.html">
            
                <a href="../project/01-环境搭建.html">
            
                    
                    01-环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../project/02-构建项目基本结构.html">
            
                <a href="../project/02-构建项目基本结构.html">
            
                    
                    02-构建项目基本结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../project/03-添加信息.html">
            
                <a href="../project/03-添加信息.html">
            
                    
                    03-添加信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../project/04-获得屏幕快照.html">
            
                <a href="../project/04-获得屏幕快照.html">
            
                    
                    04-获得屏幕快照
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../project/05-显示列表.html">
            
                <a href="../project/05-显示列表.html">
            
                    
                    05-显示列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../project/06-打开网站窗口.html">
            
                <a href="../project/06-打开网站窗口.html">
            
                    
                    06-打开网站窗口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../project/07-删除信息.html">
            
                <a href="../project/07-删除信息.html">
            
                    
                    07-删除信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../project/08-搜索信息.html">
            
                <a href="../project/08-搜索信息.html">
            
                    
                    08-搜索信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../project/09-定制菜单.html">
            
                <a href="../project/09-定制菜单.html">
            
                    
                    09-定制菜单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../project/10-项目打包部署.html">
            
                <a href="../project/10-项目打包部署.html">
            
                    
                    10-项目打包部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../thanks/">
            
                <a href="../thanks/">
            
                    
                    感谢
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >02-搭建Electron运行环境</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;"><b></b>&#x642D;&#x5EFA; Electron &#x8FD0;&#x884C;&#x73AF;&#x5883;</a></li><ul><ul><li><span class="title-icon "></span><a href="#1&#x3001;&#x5B89;&#x88C5;-electron"><b></b>1&#x3001;&#x5B89;&#x88C5; Electron</a></li><li><span class="title-icon "></span><a href="#2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;"><b></b>2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;</a></li></ul></ul></ul></div><a href="#&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;"><a name="&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;" class="anchor-navigation-ex-anchor" href="#&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;" class="plugin-anchor" href="#&#x642D;&#x5EFA;-electron-&#x8FD0;&#x884C;&#x73AF;&#x5883;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x642D;&#x5EFA; Electron &#x8FD0;&#x884C;&#x73AF;&#x5883;</h1>
<h3 id="1&#x3001;&#x5B89;&#x88C5;-electron"><a name="1&#x3001;&#x5B89;&#x88C5;-electron" class="anchor-navigation-ex-anchor" href="#1&#x3001;&#x5B89;&#x88C5;-electron"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1&#x3001;&#x5B89;&#x88C5;-electron" class="plugin-anchor" href="#1&#x3001;&#x5B89;&#x88C5;-electron"><i class="fa fa-link" aria-hidden="true"></i></a>1&#x3001;&#x5B89;&#x88C5; Electron</h3>
<pre><code>npm install electron -S
</code></pre><h3 id="2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;"><a name="2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;" class="anchor-navigation-ex-anchor" href="#2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;" class="plugin-anchor" href="#2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a>2&#x3001;&#x5C1D;&#x8BD5;&#x5B98;&#x7F51;&#x7684;&#x4E00;&#x4E2A;&#x6848;&#x4F8B;</h3>
<pre><code class="lang-shell"># &#x514B;&#x9686;&#x8FD9;&#x4ED3;&#x5E93;
git clone https://github.com/electron/electron-quick-start
# &#x8FDB;&#x5165;&#x4ED3;&#x5E93;
cd electron-quick-start
# &#x5B89;&#x88C5;&#x4F9D;&#x8D56;&#x5E93;
npm install
# &#x8FD0;&#x884C;&#x5E94;&#x7528;
npm start
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="01-Electron介绍.html" class="navigation navigation-prev " aria-label="Previous page: 01-Electron介绍">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="03-Main Process API.html" class="navigation navigation-next " aria-label="Next page: 03-Main Process API">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"02-搭建Electron运行环境","level":"1.2.2","depth":2,"next":{"title":"03-Main Process API","level":"1.2.3","depth":2,"path":"basics/03-Main Process API.md","ref":"./basics/03-Main Process API.md","articles":[]},"previous":{"title":"01-Electron介绍","level":"1.2.1","depth":2,"path":"basics/01-Electron介绍.md","ref":"./basics/01-Electron介绍.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","github","github-buttons","sharing-plus","anchor-navigation-ex","favicon","insert-logo"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"github":{"url":"https://github.com/lurongtao/felixbooks-electron"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{"shortcut":"./source/images/favicon.jpg","bookmark":"./source/images/favicon.jpg","appleTouch":"./source/images/apple-touch-icon.jpg","appleTouchMore":{"120x120":"./source/images/apple-touch-icon.jpg","180x180":"./source/images/apple-touch-icon.jpg"}},"github-buttons":{"buttons":[{"user":"lurongtao","repo":"felixbooks-electron","type":"star","size":"small","count":true}]},"expandable-chapters-small":{},"sharing":{"qq":false,"all":["google","facebook","weibo","twitter","qq","qzone","linkedin","pocket"],"douban":false,"facebook":false,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"insert-logo":{"url":"/felixbooks-electron/images/logo.png","style":"background: skyblue; width: 100%; height: 100%;"}},"theme":"default","author":"古艺散人","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"千锋大前端小册-Electron","language":"zh-hans","links":{},"gitbook":"3.2.3","description":"Electron 入门与实战"},"file":{"path":"basics/02-搭建Electron运行环境.md","mtime":"2020-03-01T05:05:26.509Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-01T09:39:06.010Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

